Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.2.5" /> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 19 | a { |
| 20 | color: blue; |
| 21 | text-decoration: underline; |
| 22 | } |
| 23 | a:visited { |
| 24 | color: fuchsia; |
| 25 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 26 | |
| 27 | em { |
| 28 | font-style: italic; |
| 29 | } |
| 30 | |
| 31 | strong { |
| 32 | font-weight: bold; |
| 33 | } |
| 34 | |
| 35 | tt { |
| 36 | color: navy; |
| 37 | } |
| 38 | |
| 39 | h1, h2, h3, h4, h5, h6 { |
| 40 | color: #527bbd; |
| 41 | font-family: sans-serif; |
| 42 | margin-top: 1.2em; |
| 43 | margin-bottom: 0.5em; |
| 44 | line-height: 1.3; |
| 45 | } |
| 46 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 47 | h1, h2, h3 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 48 | border-bottom: 2px solid silver; |
| 49 | } |
| 50 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | padding-top: 0.5em; |
| 52 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 53 | h3 { |
| 54 | float: left; |
| 55 | } |
| 56 | h3 + * { |
| 57 | clear: left; |
| 58 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 59 | |
| 60 | div.sectionbody { |
| 61 | font-family: serif; |
| 62 | margin-left: 0; |
| 63 | } |
| 64 | |
| 65 | hr { |
| 66 | border: 1px solid silver; |
| 67 | } |
| 68 | |
| 69 | p { |
| 70 | margin-top: 0.5em; |
| 71 | margin-bottom: 0.5em; |
| 72 | } |
| 73 | |
| 74 | pre { |
| 75 | padding: 0; |
| 76 | margin: 0; |
| 77 | } |
| 78 | |
| 79 | span#author { |
| 80 | color: #527bbd; |
| 81 | font-family: sans-serif; |
| 82 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 83 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 84 | } |
| 85 | span#email { |
| 86 | } |
| 87 | span#revision { |
| 88 | font-family: sans-serif; |
| 89 | } |
| 90 | |
| 91 | div#footer { |
| 92 | font-family: sans-serif; |
| 93 | font-size: small; |
| 94 | border-top: 2px solid silver; |
| 95 | padding-top: 0.5em; |
| 96 | margin-top: 4.0em; |
| 97 | } |
| 98 | div#footer-text { |
| 99 | float: left; |
| 100 | padding-bottom: 0.5em; |
| 101 | } |
| 102 | div#footer-badges { |
| 103 | float: right; |
| 104 | padding-bottom: 0.5em; |
| 105 | } |
| 106 | |
| 107 | div#preamble, |
| 108 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 109 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 110 | div.admonitionblock { |
| 111 | margin-right: 10%; |
| 112 | margin-top: 1.5em; |
| 113 | margin-bottom: 1.5em; |
| 114 | } |
| 115 | div.admonitionblock { |
| 116 | margin-top: 2.5em; |
| 117 | margin-bottom: 2.5em; |
| 118 | } |
| 119 | |
| 120 | div.content { /* Block element content. */ |
| 121 | padding: 0; |
| 122 | } |
| 123 | |
| 124 | /* Block element titles. */ |
| 125 | div.title, caption.title { |
| 126 | font-family: sans-serif; |
| 127 | font-weight: bold; |
| 128 | text-align: left; |
| 129 | margin-top: 1.0em; |
| 130 | margin-bottom: 0.5em; |
| 131 | } |
| 132 | div.title + * { |
| 133 | margin-top: 0; |
| 134 | } |
| 135 | |
| 136 | td div.title:first-child { |
| 137 | margin-top: 0.0em; |
| 138 | } |
| 139 | div.content div.title:first-child { |
| 140 | margin-top: 0.0em; |
| 141 | } |
| 142 | div.content + div.title { |
| 143 | margin-top: 0.0em; |
| 144 | } |
| 145 | |
| 146 | div.sidebarblock > div.content { |
| 147 | background: #ffffee; |
| 148 | border: 1px solid silver; |
| 149 | padding: 0.5em; |
| 150 | } |
| 151 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 152 | div.listingblock { |
| 153 | margin-right: 0%; |
| 154 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 155 | div.listingblock > div.content { |
| 156 | border: 1px solid silver; |
| 157 | background: #f4f4f4; |
| 158 | padding: 0.5em; |
| 159 | } |
| 160 | |
| 161 | div.quoteblock > div.content { |
| 162 | padding-left: 2.0em; |
| 163 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 164 | |
| 165 | div.attribution { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 166 | text-align: right; |
| 167 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 168 | div.verseblock + div.attribution { |
| 169 | text-align: left; |
| 170 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 171 | |
| 172 | div.admonitionblock .icon { |
| 173 | vertical-align: top; |
| 174 | font-size: 1.1em; |
| 175 | font-weight: bold; |
| 176 | text-decoration: underline; |
| 177 | color: #527bbd; |
| 178 | padding-right: 0.5em; |
| 179 | } |
| 180 | div.admonitionblock td.content { |
| 181 | padding-left: 0.5em; |
| 182 | border-left: 2px solid silver; |
| 183 | } |
| 184 | |
| 185 | div.exampleblock > div.content { |
| 186 | border-left: 2px solid silver; |
| 187 | padding: 0.5em; |
| 188 | } |
| 189 | |
| 190 | div.verseblock div.content { |
| 191 | white-space: pre; |
| 192 | } |
| 193 | |
| 194 | div.imageblock div.content { padding-left: 0; } |
| 195 | div.imageblock img { border: 1px solid silver; } |
| 196 | span.image img { border-style: none; } |
| 197 | |
| 198 | dl { |
| 199 | margin-top: 0.8em; |
| 200 | margin-bottom: 0.8em; |
| 201 | } |
| 202 | dt { |
| 203 | margin-top: 0.5em; |
| 204 | margin-bottom: 0; |
| 205 | font-style: italic; |
| 206 | } |
| 207 | dd > *:first-child { |
| 208 | margin-top: 0; |
| 209 | } |
| 210 | |
| 211 | ul, ol { |
| 212 | list-style-position: outside; |
| 213 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 214 | div.olist2 ol { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 215 | list-style-type: lower-alpha; |
| 216 | } |
| 217 | |
| 218 | div.tableblock > table { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 219 | border: 3px solid #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 220 | } |
| 221 | thead { |
| 222 | font-family: sans-serif; |
| 223 | font-weight: bold; |
| 224 | } |
| 225 | tfoot { |
| 226 | font-weight: bold; |
| 227 | } |
| 228 | |
| 229 | div.hlist { |
| 230 | margin-top: 0.8em; |
| 231 | margin-bottom: 0.8em; |
| 232 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 233 | div.hlist td { |
| 234 | padding-bottom: 5px; |
| 235 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 236 | td.hlist1 { |
| 237 | vertical-align: top; |
| 238 | font-style: italic; |
| 239 | padding-right: 0.8em; |
| 240 | } |
| 241 | td.hlist2 { |
| 242 | vertical-align: top; |
| 243 | } |
| 244 | |
| 245 | @media print { |
| 246 | div#footer-badges { display: none; } |
| 247 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 248 | |
| 249 | div#toctitle { |
| 250 | color: #527bbd; |
| 251 | font-family: sans-serif; |
| 252 | font-size: 1.1em; |
| 253 | font-weight: bold; |
| 254 | margin-top: 1.0em; |
| 255 | margin-bottom: 0.1em; |
| 256 | } |
| 257 | |
| 258 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 259 | margin-top: 0; |
| 260 | margin-bottom: 0; |
| 261 | } |
| 262 | div.toclevel2 { |
| 263 | margin-left: 2em; |
| 264 | font-size: 0.9em; |
| 265 | } |
| 266 | div.toclevel3 { |
| 267 | margin-left: 4em; |
| 268 | font-size: 0.9em; |
| 269 | } |
| 270 | div.toclevel4 { |
| 271 | margin-left: 6em; |
| 272 | font-size: 0.9em; |
| 273 | } |
| 274 | include1::./stylesheets/xhtml11-manpage.css[] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 275 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 276 | |
| 277 | div.sidebar-content { |
| 278 | background: #ffffee; |
| 279 | border: 1px solid silver; |
| 280 | padding: 0.5em; |
| 281 | } |
| 282 | div.sidebar-title, div.image-title { |
| 283 | font-family: sans-serif; |
| 284 | font-weight: bold; |
| 285 | margin-top: 0.0em; |
| 286 | margin-bottom: 0.5em; |
| 287 | } |
| 288 | |
| 289 | div.listingblock div.content { |
| 290 | border: 1px solid silver; |
| 291 | background: #f4f4f4; |
| 292 | padding: 0.5em; |
| 293 | } |
| 294 | |
| 295 | div.quoteblock-content { |
| 296 | padding-left: 2.0em; |
| 297 | } |
| 298 | |
| 299 | div.exampleblock-content { |
| 300 | border-left: 2px solid silver; |
| 301 | padding-left: 0.5em; |
| 302 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 303 | |
| 304 | /* IE6 sets dynamically generated links as visited. */ |
| 305 | div#toc a:visited { color: blue; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 306 | </style> |
| 307 | <title>git-fetch(1)</title> |
| 308 | </head> |
| 309 | <body> |
| 310 | <div id="header"> |
| 311 | <h1> |
| 312 | git-fetch(1) Manual Page |
| 313 | </h1> |
| 314 | <h2>NAME</h2> |
| 315 | <div class="sectionbody"> |
| 316 | <p>git-fetch - |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 317 | Download objects and refs from another repository |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 318 | </p> |
| 319 | </div> |
| 320 | </div> |
| 321 | <h2>SYNOPSIS</h2> |
| 322 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 323 | <div class="para"><p><em>git fetch</em> <options> <repository> <refspec>…</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 324 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 325 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 326 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 327 | <div class="para"><p>Fetches named heads or tags from another repository, along with |
| 328 | the objects necessary to complete them.</p></div> |
| 329 | <div class="para"><p>The ref names and their object names of fetched refs are stored |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 330 | in <tt>.git/FETCH_HEAD</tt>. This information is left for a later merge |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 331 | operation done by <em>git-merge</em>.</p></div> |
| 332 | <div class="para"><p>When <refspec> stores the fetched result in tracking branches, |
Junio C Hamano | 8be7073 | 2007-02-10 01:28:40 | [diff] [blame] | 333 | the tags that point at these branches are automatically |
| 334 | followed. This is done by first fetching from the remote using |
| 335 | the given <refspec>s, and if the repository has objects that are |
| 336 | pointed by remote tags that it does not yet have, then fetch |
| 337 | those missing tags. If the other end has tags that point at |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 338 | branches you are not interested in, you will not get them.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 339 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 340 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 341 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 342 | <div class="vlist"><dl> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 343 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 344 | -a |
| 345 | </dt> |
| 346 | <dt> |
| 347 | --append |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 348 | </dt> |
| 349 | <dd> |
| 350 | <p> |
| 351 | Append ref names and object names of fetched refs to the |
| 352 | existing contents of <tt>.git/FETCH_HEAD</tt>. Without this |
| 353 | option old data in <tt>.git/FETCH_HEAD</tt> will be overwritten. |
| 354 | </p> |
| 355 | </dd> |
| 356 | <dt> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 357 | --depth=<depth> |
Junio C Hamano | e663a7a | 2006-01-25 12:37:28 | [diff] [blame] | 358 | </dt> |
Junio C Hamano | e663a7a | 2006-01-25 12:37:28 | [diff] [blame] | 359 | <dd> |
| 360 | <p> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 361 | Deepen the history of a <em>shallow</em> repository created by |
| 362 | <tt>git clone</tt> with <tt>--depth=<depth></tt> option (see <a href="git-clone.html">git-clone(1)</a>) |
| 363 | by the specified number of commits. |
Junio C Hamano | e663a7a | 2006-01-25 12:37:28 | [diff] [blame] | 364 | </p> |
| 365 | </dd> |
| 366 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 367 | -f |
| 368 | </dt> |
| 369 | <dt> |
| 370 | --force |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 371 | </dt> |
| 372 | <dd> |
| 373 | <p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 374 | When <em>git-fetch</em> is used with <tt><rbranch>:<lbranch></tt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 375 | refspec, it refuses to update the local branch |
| 376 | <tt><lbranch></tt> unless the remote branch <tt><rbranch></tt> it |
| 377 | fetches is a descendant of <tt><lbranch></tt>. This option |
| 378 | overrides that check. |
| 379 | </p> |
| 380 | </dd> |
| 381 | <dt> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 382 | -k |
| 383 | </dt> |
| 384 | <dt> |
| 385 | --keep |
| 386 | </dt> |
| 387 | <dd> |
| 388 | <p> |
| 389 | Keep downloaded pack. |
| 390 | </p> |
| 391 | </dd> |
| 392 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 393 | -n |
| 394 | </dt> |
| 395 | <dt> |
| 396 | --no-tags |
Junio C Hamano | 4d04a40 | 2006-01-09 00:53:28 | [diff] [blame] | 397 | </dt> |
| 398 | <dd> |
| 399 | <p> |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 400 | By default, tags that point at objects that are downloaded |
| 401 | from the remote repository are fetched and stored locally. |
| 402 | This option disables this automatic tag following. |
Junio C Hamano | 4d04a40 | 2006-01-09 00:53:28 | [diff] [blame] | 403 | </p> |
| 404 | </dd> |
| 405 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 406 | -t |
| 407 | </dt> |
| 408 | <dt> |
| 409 | --tags |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 410 | </dt> |
| 411 | <dd> |
| 412 | <p> |
Junio C Hamano | 4d04a40 | 2006-01-09 00:53:28 | [diff] [blame] | 413 | Most of the tags are fetched automatically as branch |
| 414 | heads are downloaded, but tags that do not point at |
| 415 | objects reachable from the branch heads that are being |
| 416 | tracked will not be fetched by this mechanism. This |
| 417 | flag lets all tags and their associated objects be |
| 418 | downloaded. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 419 | </p> |
| 420 | </dd> |
| 421 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 422 | -u |
| 423 | </dt> |
| 424 | <dt> |
| 425 | --update-head-ok |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 426 | </dt> |
| 427 | <dd> |
| 428 | <p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 429 | By default <em>git-fetch</em> refuses to update the head which |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 430 | corresponds to the current branch. This flag disables the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 431 | check. This is purely for the internal use for <em>git-pull</em> |
| 432 | to communicate with <em>git-fetch</em>, and unless you are |
Junio C Hamano | b288d9e | 2007-01-02 00:04:15 | [diff] [blame] | 433 | implementing your own Porcelain you are not supposed to |
| 434 | use it. |
| 435 | </p> |
| 436 | </dd> |
| 437 | <dt> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 438 | --upload-pack <upload-pack> |
Junio C Hamano | b288d9e | 2007-01-02 00:04:15 | [diff] [blame] | 439 | </dt> |
| 440 | <dd> |
| 441 | <p> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 442 | When given, and the repository to fetch from is handled |
| 443 | by <em>git-fetch-pack</em>, <em>--exec=<upload-pack></em> is passed to |
| 444 | the command to specify non-default path for the command |
| 445 | run on the other end. |
| 446 | </p> |
| 447 | </dd> |
| 448 | <dt> |
| 449 | -q |
| 450 | </dt> |
| 451 | <dt> |
| 452 | --quiet |
| 453 | </dt> |
| 454 | <dd> |
| 455 | <p> |
| 456 | Pass --quiet to git-fetch-pack and silence any other internally |
| 457 | used git commands. |
| 458 | </p> |
| 459 | </dd> |
| 460 | <dt> |
| 461 | -v |
| 462 | </dt> |
| 463 | <dt> |
| 464 | --verbose |
| 465 | </dt> |
| 466 | <dd> |
| 467 | <p> |
| 468 | Be verbose. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 469 | </p> |
| 470 | </dd> |
| 471 | <dt> |
| 472 | <repository> |
| 473 | </dt> |
| 474 | <dd> |
| 475 | <p> |
| 476 | The "remote" repository that is the source of a fetch |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 477 | or pull operation. This parameter can be either a URL |
| 478 | (see the section <a href="#URLS">GIT URLS</a> below) or the name |
| 479 | of a remote (see the section <a href="#REMOTES">REMOTES</a> below). |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 480 | </p> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 481 | </dd> |
| 482 | <dt> |
| 483 | <refspec> |
| 484 | </dt> |
| 485 | <dd> |
| 486 | <p> |
Junio C Hamano | 8b6e23b | 2009-02-01 06:36:08 | [diff] [blame] | 487 | The format of a <refspec> parameter is an optional plus |
| 488 | <tt>+</tt>, followed by the source ref <src>, followed |
| 489 | by a colon <tt>:</tt>, followed by the destination ref <dst>. |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 490 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 491 | <div class="para"><p>The remote ref that matches <src> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 492 | is fetched, and if <dst> is not empty string, the local |
Junio C Hamano | 3f680f3 | 2009-11-16 02:10:54 | [diff] [blame] | 493 | ref that matches it is fast-forwarded using <src>. |
Junio C Hamano | 8b6e23b | 2009-02-01 06:36:08 | [diff] [blame] | 494 | If the optional plus <tt>+</tt> is used, the local ref |
Junio C Hamano | 3f680f3 | 2009-11-16 02:10:54 | [diff] [blame] | 495 | is updated even if it does not result in a fast-forward |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 496 | update.</p></div> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 497 | <div class="admonitionblock"> |
| 498 | <table><tr> |
| 499 | <td class="icon"> |
| 500 | <div class="title">Note</div> |
| 501 | </td> |
| 502 | <td class="content">If the remote branch from which you want to pull is |
| 503 | modified in non-linear ways such as being rewound and |
| 504 | rebased frequently, then a pull will attempt a merge with |
| 505 | an older version of itself, likely conflict, and fail. |
| 506 | It is under these conditions that you would want to use |
| 507 | the <tt>+</tt> sign to indicate non-fast-forward updates will |
| 508 | be needed. There is currently no easy way to determine |
| 509 | or declare that a branch will be made available in a |
| 510 | repository with this behavior; the pulling user simply |
| 511 | must know this is the expected usage pattern for a branch.</td> |
| 512 | </tr></table> |
| 513 | </div> |
| 514 | <div class="admonitionblock"> |
| 515 | <table><tr> |
| 516 | <td class="icon"> |
| 517 | <div class="title">Note</div> |
| 518 | </td> |
| 519 | <td class="content">You never do your own development on branches that appear |
| 520 | on the right hand side of a <refspec> colon on <tt>Pull:</tt> lines; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 521 | they are to be updated by <em>git-fetch</em>. If you intend to do |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 522 | development derived from a remote branch <tt>B</tt>, have a <tt>Pull:</tt> |
| 523 | line to track it (i.e. <tt>Pull: B:remote-B</tt>), and have a separate |
| 524 | branch <tt>my-B</tt> to do your development on top of it. The latter |
| 525 | is created by <tt>git branch my-B remote-B</tt> (or its equivalent <tt>git |
| 526 | checkout -b my-B remote-B</tt>). Run <tt>git fetch</tt> to keep track of |
| 527 | the progress of the remote side, and when you see something new |
| 528 | on the remote branch, merge it into your development branch with |
Junio C Hamano | b288d9e | 2007-01-02 00:04:15 | [diff] [blame] | 529 | <tt>git pull . remote-B</tt>, while you are on <tt>my-B</tt> branch.</td> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 530 | </tr></table> |
| 531 | </div> |
| 532 | <div class="admonitionblock"> |
| 533 | <table><tr> |
| 534 | <td class="icon"> |
| 535 | <div class="title">Note</div> |
| 536 | </td> |
| 537 | <td class="content">There is a difference between listing multiple <refspec> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 538 | directly on <em>git-pull</em> command line and having multiple |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 539 | <tt>Pull:</tt> <refspec> lines for a <repository> and running |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 540 | <em>git-pull</em> command without any explicit <refspec> parameters. |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 541 | <refspec> listed explicitly on the command line are always |
| 542 | merged into the current branch after fetching. In other words, |
| 543 | if you list more than one remote refs, you would be making |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 544 | an Octopus. While <em>git-pull</em> run without any explicit <refspec> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 545 | parameter takes default <refspec>s from <tt>Pull:</tt> lines, it |
| 546 | merges only the first <refspec> found into the current branch, |
| 547 | after fetching all the remote refs. This is because making an |
| 548 | Octopus from remote refs is rarely done, while keeping track |
| 549 | of multiple remote heads in one-go by fetching more than one |
| 550 | is often useful.</td> |
| 551 | </tr></table> |
| 552 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 553 | <div class="para"><p>Some short-cut notations are also supported.</p></div> |
| 554 | <div class="ilist"><ul> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 555 | <li> |
| 556 | <p> |
| 557 | <tt>tag <tag></tt> means the same as <tt>refs/tags/<tag>:refs/tags/<tag></tt>; |
| 558 | it requests fetching everything up to the given tag. |
| 559 | </p> |
| 560 | </li> |
| 561 | <li> |
| 562 | <p> |
| 563 | A parameter <ref> without a colon is equivalent to |
| 564 | <ref>: when pulling/fetching, so it merges <ref> into the current |
| 565 | branch without storing the remote branch anywhere locally |
| 566 | </p> |
| 567 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 568 | </ul></div> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 569 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 570 | </dl></div> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 571 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 572 | <h2 id="_git_urls_a_id_urls_a">GIT URLS<a id="URLS"></a></h2> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 573 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 574 | <div class="para"><p>One of the following notations can be used |
| 575 | to name the remote repository:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 576 | <div class="exampleblock"> |
| 577 | <div class="exampleblock-content"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 578 | <div class="ilist"><ul> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 579 | <li> |
| 580 | <p> |
| 581 | rsync://host.xz/path/to/repo.git/ |
| 582 | </p> |
| 583 | </li> |
| 584 | <li> |
| 585 | <p> |
Junio C Hamano | a3bb6eb | 2009-02-05 01:26:33 | [diff] [blame] | 586 | http://host.xz[:port]/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 587 | </p> |
| 588 | </li> |
| 589 | <li> |
| 590 | <p> |
Junio C Hamano | a3bb6eb | 2009-02-05 01:26:33 | [diff] [blame] | 591 | https://host.xz[:port]/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 592 | </p> |
| 593 | </li> |
| 594 | <li> |
| 595 | <p> |
Junio C Hamano | a3bb6eb | 2009-02-05 01:26:33 | [diff] [blame] | 596 | git://host.xz[:port]/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 597 | </p> |
| 598 | </li> |
| 599 | <li> |
| 600 | <p> |
Junio C Hamano | a3bb6eb | 2009-02-05 01:26:33 | [diff] [blame] | 601 | git://host.xz[:port]/~user/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 602 | </p> |
| 603 | </li> |
| 604 | <li> |
| 605 | <p> |
Junio C Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 606 | ssh://[user@]host.xz[:port]/path/to/repo.git/ |
| 607 | </p> |
| 608 | </li> |
| 609 | <li> |
| 610 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 611 | ssh://[user@]host.xz/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 612 | </p> |
| 613 | </li> |
| 614 | <li> |
| 615 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 616 | ssh://[user@]host.xz/~user/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 617 | </p> |
| 618 | </li> |
| 619 | <li> |
| 620 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 621 | ssh://[user@]host.xz/~/path/to/repo.git |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 622 | </p> |
| 623 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 624 | </ul></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 625 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 626 | <div class="para"><p>SSH is the default transport protocol over the network. You can |
Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 627 | optionally specify which user to log-in as, and an alternate, |
| 628 | scp-like syntax is also supported. Both syntaxes support |
Junio C Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 629 | username expansion, as does the native git protocol, but |
| 630 | only the former supports port specification. The following |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 631 | three are identical to the last three above, respectively:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 632 | <div class="exampleblock"> |
| 633 | <div class="exampleblock-content"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 634 | <div class="ilist"><ul> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 635 | <li> |
| 636 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 637 | [user@]host.xz:/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 638 | </p> |
| 639 | </li> |
| 640 | <li> |
| 641 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 642 | [user@]host.xz:~user/path/to/repo.git/ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 643 | </p> |
| 644 | </li> |
| 645 | <li> |
| 646 | <p> |
Junio C Hamano | 7ccb9fd | 2006-07-15 01:38:40 | [diff] [blame] | 647 | [user@]host.xz:path/to/repo.git |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 648 | </p> |
| 649 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 650 | </ul></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 651 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 652 | <div class="para"><p>To sync with a local directory, you can use:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 653 | <div class="exampleblock"> |
| 654 | <div class="exampleblock-content"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 655 | <div class="ilist"><ul> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 656 | <li> |
| 657 | <p> |
| 658 | /path/to/repo.git/ |
| 659 | </p> |
| 660 | </li> |
Junio C Hamano | b1d6e88 | 2007-08-11 08:30:16 | [diff] [blame] | 661 | <li> |
| 662 | <p> |
| 663 | file:///path/to/repo.git/ |
| 664 | </p> |
| 665 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 666 | </ul></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 667 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 668 | <div class="para"><p>They are mostly equivalent, except when cloning. See |
| 669 | <a href="git-clone.html">git-clone(1)</a> for details.</p></div> |
| 670 | <div class="para"><p>If there are a large number of similarly-named remote repositories and |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 671 | you want to use a different format for them (such that the URLs you |
| 672 | use will be rewritten into URLs that work), you can create a |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 673 | configuration section of the form:</p></div> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 674 | <div class="listingblock"> |
| 675 | <div class="content"> |
| 676 | <pre><tt> [url "<actual url base>"] |
| 677 | insteadOf = <other url base></tt></pre> |
| 678 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 679 | <div class="para"><p>For example, with this:</p></div> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 680 | <div class="listingblock"> |
| 681 | <div class="content"> |
| 682 | <pre><tt> [url "git://git.host.xz/"] |
| 683 | insteadOf = host.xz:/path/to/ |
| 684 | insteadOf = work:</tt></pre> |
| 685 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 686 | <div class="para"><p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be |
| 687 | rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p></div> |
Junio C Hamano | 7df6dcf | 2009-09-13 09:51:17 | [diff] [blame] | 688 | <div class="para"><p>If you want to rewrite URLs for push only, you can create a |
| 689 | configuration section of the form:</p></div> |
| 690 | <div class="listingblock"> |
| 691 | <div class="content"> |
| 692 | <pre><tt> [url "<actual url base>"] |
| 693 | pushInsteadOf = <other url base></tt></pre> |
| 694 | </div></div> |
| 695 | <div class="para"><p>For example, with this:</p></div> |
| 696 | <div class="listingblock"> |
| 697 | <div class="content"> |
| 698 | <pre><tt> [url "ssh://example.org/"] |
| 699 | pushInsteadOf = git://example.org/</tt></pre> |
| 700 | </div></div> |
| 701 | <div class="para"><p>a URL like "git://example.org/path/to/repo.git" will be rewritten to |
| 702 | "ssh://example.org/path/to/repo.git" for pushes, but pulls will still |
| 703 | use the original URL.</p></div> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 704 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 705 | <h2 id="_remotes_a_id_remotes_a">REMOTES<a id="REMOTES"></a></h2> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 706 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 707 | <div class="para"><p>The name of one of the following can be used instead |
| 708 | of a URL as <tt><repository></tt> argument:</p></div> |
| 709 | <div class="ilist"><ul> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 710 | <li> |
| 711 | <p> |
| 712 | a remote in the git configuration file: <tt>$GIT_DIR/config</tt>, |
| 713 | </p> |
| 714 | </li> |
| 715 | <li> |
| 716 | <p> |
| 717 | a file in the <tt>$GIT_DIR/remotes</tt> directory, or |
| 718 | </p> |
| 719 | </li> |
| 720 | <li> |
| 721 | <p> |
| 722 | a file in the <tt>$GIT_DIR/branches</tt> directory. |
| 723 | </p> |
| 724 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 725 | </ul></div> |
| 726 | <div class="para"><p>All of these also allow you to omit the refspec from the command line |
| 727 | because they each contain a refspec which git will use by default.</p></div> |
| 728 | <h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3><div style="clear:left"></div> |
| 729 | <div class="para"><p>You can choose to provide the name of a remote which you had previously |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 730 | configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a> |
| 731 | or even by a manual edit to the <tt>$GIT_DIR/config</tt> file. The URL of |
| 732 | this remote will be used to access the repository. The refspec |
| 733 | of this remote will be used by default when you do |
| 734 | not provide a refspec on the command line. The entry in the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 735 | config file would appear like this:</p></div> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 736 | <div class="listingblock"> |
| 737 | <div class="content"> |
| 738 | <pre><tt> [remote "<name>"] |
| 739 | url = <url> |
Junio C Hamano | 0e88f3e | 2009-06-21 08:03:25 | [diff] [blame] | 740 | pushurl = <pushurl> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 741 | push = <refspec> |
| 742 | fetch = <refspec></tt></pre> |
| 743 | </div></div> |
Junio C Hamano | 0e88f3e | 2009-06-21 08:03:25 | [diff] [blame] | 744 | <div class="para"><p>The <tt><pushurl></tt> is used for pushes only. It is optional and defaults |
| 745 | to <tt><url></tt>.</p></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 746 | <h3 id="_named_file_in_tt_git_dir_remotes_tt">Named file in <tt>$GIT_DIR/remotes</tt></h3><div style="clear:left"></div> |
| 747 | <div class="para"><p>You can choose to provide the name of a |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 748 | file in <tt>$GIT_DIR/remotes</tt>. The URL |
| 749 | in this file will be used to access the repository. The refspec |
| 750 | in this file will be used as default when you do not |
| 751 | provide a refspec on the command line. This file should have the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 752 | following format:</p></div> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 753 | <div class="listingblock"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 754 | <div class="content"> |
Junio C Hamano | d3361ad | 2007-01-01 03:20:24 | [diff] [blame] | 755 | <pre><tt> URL: one of the above URL format |
| 756 | Push: <refspec> |
| 757 | Pull: <refspec> |
| 758 | </tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 759 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 760 | <div class="para"><p><tt>Push:</tt> lines are used by <em>git-push</em> and |
| 761 | <tt>Pull:</tt> lines are used by <em>git-pull</em> and <em>git-fetch</em>. |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 762 | Multiple <tt>Push:</tt> and <tt>Pull:</tt> lines may |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 763 | be specified for additional branch mappings.</p></div> |
| 764 | <h3 id="_named_file_in_tt_git_dir_branches_tt">Named file in <tt>$GIT_DIR/branches</tt></h3><div style="clear:left"></div> |
| 765 | <div class="para"><p>You can choose to provide the name of a |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 766 | file in <tt>$GIT_DIR/branches</tt>. |
| 767 | The URL in this file will be used to access the repository. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 768 | This file should have the following format:</p></div> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 769 | <div class="listingblock"> |
Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 770 | <div class="content"> |
Junio C Hamano | 054ea08 | 2008-06-01 08:26:34 | [diff] [blame] | 771 | <pre><tt> <url>#<head></tt></pre> |
Junio C Hamano | 249572f | 2006-10-24 05:44:08 | [diff] [blame] | 772 | </div></div> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 773 | <div class="para"><p><tt><url></tt> is required; <tt>#<head></tt> is optional.</p></div> |
| 774 | <div class="para"><p>Depending on the operation, git will use one of the following |
| 775 | refspecs, if you don't provide one on the command line. |
| 776 | <tt><branch></tt> is the name of this file in <tt>$GIT_DIR/branches</tt> and |
| 777 | <tt><head></tt> defaults to <tt>master</tt>.</p></div> |
| 778 | <div class="para"><p>git fetch uses:</p></div> |
Junio C Hamano | 1caaf47 | 2006-12-31 08:29:35 | [diff] [blame] | 779 | <div class="listingblock"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 780 | <div class="content"> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 781 | <pre><tt> refs/heads/<head>:refs/heads/<branch></tt></pre> |
| 782 | </div></div> |
| 783 | <div class="para"><p>git push uses:</p></div> |
| 784 | <div class="listingblock"> |
| 785 | <div class="content"> |
| 786 | <pre><tt> HEAD:refs/heads/<head></tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 787 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 788 | </div> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 789 | <h2 id="_examples">EXAMPLES</h2> |
| 790 | <div class="sectionbody"> |
| 791 | <div class="ilist"><ul> |
| 792 | <li> |
| 793 | <p> |
| 794 | Update the remote-tracking branches: |
| 795 | </p> |
| 796 | <div class="listingblock"> |
| 797 | <div class="content"> |
| 798 | <pre><tt>$ git fetch origin</tt></pre> |
| 799 | </div></div> |
| 800 | <div class="para"><p>The above command copies all branches from the remote refs/heads/ |
| 801 | namespace and stores them to the local refs/remotes/origin/ namespace, |
| 802 | unless the branch.<name>.fetch option is used to specify a non-default |
| 803 | refspec.</p></div> |
| 804 | </li> |
| 805 | <li> |
| 806 | <p> |
| 807 | Using refspecs explicitly: |
| 808 | </p> |
| 809 | <div class="listingblock"> |
| 810 | <div class="content"> |
| 811 | <pre><tt>$ git fetch origin +pu:pu maint:tmp</tt></pre> |
| 812 | </div></div> |
| 813 | <div class="para"><p>This updates (or creates, as necessary) branches <tt>pu</tt> and <tt>tmp</tt> in |
| 814 | the local repository by fetching from the branches (respectively) |
| 815 | <tt>pu</tt> and <tt>maint</tt> from the remote repository.</p></div> |
| 816 | <div class="para"><p>The <tt>pu</tt> branch will be updated even if it is does not fast-forward, |
| 817 | because it is prefixed with a plus sign; <tt>tmp</tt> will not be.</p></div> |
| 818 | </li> |
| 819 | </ul></div> |
| 820 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 821 | <h2 id="_see_also">SEE ALSO</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 822 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 823 | <div class="para"><p><a href="git-pull.html">git-pull(1)</a></p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 824 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 825 | <h2 id="_author">Author</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 826 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 827 | <div class="para"><p>Written by Linus Torvalds <torvalds@osdl.org> and |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 828 | Junio C Hamano <gitster@pobox.com></p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 829 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 830 | <h2 id="_documentation">Documentation</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 831 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 832 | <div class="para"><p>Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 833 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 834 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 835 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 836 | <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 837 | </div> |
| 838 | <div id="footer"> |
| 839 | <div id="footer-text"> |
Junio C Hamano | 3f680f3 | 2009-11-16 02:10:54 | [diff] [blame] | 840 | Last updated 2009-11-16 02:10:11 UTC |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 841 | </div> |
| 842 | </div> |
| 843 | </body> |
| 844 | </html> |